package 双指针;

public class Demo02 {
    static class Solution {
        /*
        * 双指针
        * */
        public boolean isSubsequence(String s, String t) {
            if(s.length() == 0 || s == null){
                return true;
            }
            int index = 0;
            for(int i = 0; i<t.length(); i++){
                if(t.charAt(i) == s.charAt(index)){
                    index++;
                }
                if(index == s.length()){
                    return true;
                }
            }
            return false;
        }
    }
}
